package com.hc.mapper;

import com.hc.entity.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RoleMapper {
    @Select("SELECT	tb_role.* " +
            "FROM tb_role " +
            "INNER JOIN tb_user_role ON tb_role.id = tb_user_role.role_id  " +
            "WHERE	tb_user_role.user_id = #{userId} ")
    List<Role> selectRolesByUserId(Integer userId);
}
